package com.neuedu.his.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neuedu.his.entity.Register;
import com.neuedu.his.service.RegisterService;

@RestController
@RequestMapping("/register")
public class RegisterController {

	@Autowired
	private RegisterService service;
	
	@RequestMapping("/selectAll")
//  http://localhost:8088/register/selectAll
	public List<Register> selectAll(Register u){
		return service.selectAll(u);
	}
	
	@RequestMapping("/selectBycasenumber")
//  http://localhost:8088/register/selectBycasenumber?realname=李
	public List<Register> selectBycasenumber(Register u){
		return service.selectBycasenumber(u);
	}
	
	@RequestMapping("/add")
//  http://localhost:8088/register/add?casenumber=600000&realname=李太白&gender=71&idnumber=1&birthdate=1900-01-01&age=11&agetype=岁&homeaddress=111&visitdate=1919-01-01&noon=1&deptid=1&userid=1&registleid=1&settleid=1&isbook=1&registtime=2019-01-01 09:20:20&registerid=1&visitstate=1
	public int add(Register u){
		return service.add(u);
	}
	
	@RequestMapping("/update")
//  http://localhost:8088/register/update?casenumber=600000&realname=李太白1&gender=70&idnumber=1&birthdate=1900-01-01&age=11&agetype=岁&homeaddress=111&visitdate=1919-01-01&noon=1&deptid=1&userid=1&registleid=1&settleid=1&isbook=1&registtime=2019-01-01 09:20:20&registerid=1&visitstate=1&id=38
	public int update(Register u){
		return service.update(u);
	}
	
	@RequestMapping("/delete")
//  http://localhost:8088/register/delete?id=38
	public int delete(Register u){
		return service.delete(u);
	}
	
	@RequestMapping("/updatevisitstate")
//  http://localhost:8088/register/updatevisitstate?id=3
	public int updatevisitstate(Register u){
		return service.updatevisitstate(u);
	}
}
